﻿using System.Windows.Controls;
using Com.JJ1369.Infrastructure;
using Com.JJ1369.Infrastructure.View;
using System.ComponentModel.Composition;
using Microsoft.Practices.Prism.Regions;
using System;
using Telerik.Windows.Controls;

namespace Com.JJ1369.HumanResource.Department.View
{
    [ViewExport(RegionName = RegionName.MainNavigationRegion)]
    [PartCreationPolicy(System.ComponentModel.Composition.CreationPolicy.NonShared)]
    public partial class NavigationView : UserControl
    {
        private IRegionManager _RegionManager;

        [ImportingConstructor]
        public NavigationView(IRegionManager manager)
        {
            InitializeComponent();
            this._RegionManager = manager;
        }

        private void NavigationPanel_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            if ((e.Source as RadPanelBarItem).Tag != null)
            {
                this._RegionManager.RequestNavigate(RegionName.MainContentRegion, new Uri((e.Source as RadPanelBarItem).Tag.ToString(), UriKind.Relative));
            }
        }
    }
}
